/*
   File: ValidateTokenResponseDto.java
   Copyright 2004-2010 99Bill Corporation. All rights reserved.
   Created at   2011-8-30
   Author       zhe.yang
   Changed at   2011-8-30
 */

package com.bill99.golden.inf.sso.mdp.dto;

import java.io.Serializable;
import java.util.Date;

import com.bill99.golden.inf.sso.client.SSOInfo;

/**
 * Token验证结果
 */
public class ValidateTokenResponseDto implements Serializable, SSOInfo {

	private static final long serialVersionUID = -3173520753149462168L;
	/**
	 * 验证的结果
	 */
	private boolean valid;
	/**
	 * 错误码
	 */
	private String errorCode = "";

	/**
	 * 校验码
	 */
	private String checkCode;
	/**
	 * 令牌
	 */
	private String token;
	/**
	 * 会员ID
	 */
	private String userId;

	/**
	 * 用户代码
	 */
	private String userCode;
	/**
	 * 用户名称
	 */
	private String userName;
	/**
	 * 组织ID
	 */
	private String orgId;
	/**
	 * 组织代码
	 */
	private String orgCode;
	/**
	 * 组织名称
	 */
	private String orgName;
	/**
	 * 部门ID
	 */
	private String departmentId;
	/**
	 * 部门代码
	 */
	private String departmentCode;
	/**
	 * 部门名称
	 */
	private String departmentName;
	/**
	 * 备注
	 */
	private String memo;

	/**
	 * 令牌更新时间
	 */
	private long updateTime = System.currentTimeMillis();
	/**
	 * 创建时间
	 */
	private Date createTime = new Date();

	/**
	 * @return the valid
	 */
	public boolean isValid() {
		return valid;
	}

	/**
	 * @param valid
	 *            the valid to set
	 */
	public void setValid(boolean valid) {
		this.valid = valid;
	}

	/**
	 * @return the errorCode
	 */
	public String getErrorCode() {
		return errorCode;
	}

	/**
	 * @param errorCode
	 *            the errorCode to set
	 */
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

	public String getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}

	public String getDepartmentCode() {
		return departmentCode;
	}

	public void setDepartmentCode(String departmentCode) {
		this.departmentCode = departmentCode;
	}

	public String getDepartmentName() {
		return departmentName;
	}

	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getCheckCode() {
		return checkCode;
	}

	public void setCheckCode(String checkCode) {
		this.checkCode = checkCode;
	}

	public long getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(long updateTime) {
		this.updateTime = updateTime;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void refreshUpdateTime() {
		this.updateTime = System.currentTimeMillis();
	}

	@Override
	public String toString() {
		return "ValidateTokenResponseDto [valid=" + valid + ", errorCode="
				+ errorCode + ", checkCode=" + checkCode + ", token=" + token
				+ ", userId=" + userId + ", userCode=" + userCode
				+ ", userName=" + userName + ", orgId=" + orgId + ", orgCode="
				+ orgCode + ", orgName=" + orgName + ", departmentId="
				+ departmentId + ", departmentCode=" + departmentCode
				+ ", departmentName=" + departmentName + ", memo=" + memo
				+ ", updateTime=" + updateTime + ", createTime=" + createTime
				+ "]";
	}

}
